<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
  <link rel="stylesheet" href="./font-awesome-4.7.0/css/font-awesome.min.css">
  <style>
    * {
      box-sizing: border-box;
    }
    .fa {
      font-weight: bold;
    }
    body {
      display: flex;
      justify-content: center;
      align-items: center;
      height: 100vh;
      background-color: #8e44ad;
      color: #fff;
    }
    .counter-container {
      display: flex;
      flex-direction: column;
      justify-content: center;
      text-align: center;
      margin: 30px 50px;
    }
    .counter {
      font-size: 60px;
      margin-top: 10px;
    }
    @media (max-width: 580px) {
      body {
        flex-direction: column;
      }
    }
  </style>
</head>
<body>
  <div class="counter-container">
    <i class="fa fa-twitter fa-3x"></i>
    <div class="counter" data-target="12000"></div>
    <span>Twitter Followers</span>
  </div>
  <div class="counter-container">
    <i class="fa fa-youtube fa-3x"></i>
    <div class="counter" data-target="5000"></div>
    <span>YouTube subscribers</span>
  </div>
  <div class="counter-container">
    <i class="fa fa-facebook fa-3x"></i>
    <div class="counter" data-target="7500"></div>
    <span>Facebook Fans</span>
  </div>

  <script>
    const counters = document.querySelectorAll(".counter");

    counters.forEach(counter => {
      counter.innerHTML = "0"
      const updateCounter = () => {
        const target = +counter.getAttribute("data-target");
        const c = +counter.innerHTML;

        const increment = target / 200;
        if (c < target) {
          counter.innerHTML = `${Math.ceil(increment + c)}`;
          setTimeout(updateCounter, 1);
        }else{
          counter.innerHTML = target;
        };
      };

      updateCounter();
    });
  </script>
</body>
</html>